package com.mrd.gtimpframe.repository;

import com.mrd.gtimpframe.entity.DeclaOperationRecord;
import com.mrd.gtimpframe.entity.OperationStatistics;
import com.mrd.gtimpframe.entity.OperationalEfficiency;
import com.mrd.gtimpframe.vo.DeclaOperationRecordVO;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface DeclaOperationRecordMapper {
    int deleteByPrimaryKey(String id);

    int insert(DeclaOperationRecord record);

    int insertSelective(DeclaOperationRecord record);

    DeclaOperationRecord selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(DeclaOperationRecord record);

    int updateByPrimaryKey(DeclaOperationRecord record);

    int batchInsert(List<DeclaOperationRecord> recordList);

    List<Map> selectForGrid(Map params);

    /**
     * 根据报关单ID查询操作记录
     * 封装成页面对象
     * 用于查看报关单历史操作记录
     *
     * @param did 报关单ID
     */
    List<DeclaOperationRecordVO> selectVOByDid(String did);

    /**
     * 统计报关单中，对应操作项的操作记录数量。
     *
     * @param did     报关单ID
     * @param itCodes 操作项代码
     * @return 统计数量
     */
    int countByDidAndCodes(@Param("did") String did, @Param("itCodes") List<String> itCodes);

    /**
     * 查询业务操作效率
     */
    List<OperationalEfficiency> getOperationalEfficiency(@Param("whereCase") String whereCase);

    /**
     * 业务操作量统计
     */
    List<OperationStatistics> getOperationStatistics(@Param("whereCase") String whereCase, @Param("declarationType") String declarationType);
}
